<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript" src="vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <style type="text/css">
        el-input{
            width: 10px;
        }
    </style>
</head>
<body>
<div id="app">
    <el-form v-model="info" status-icon :rules="rules" ref="info" label-width="100px"
             class="demo-ruleForm" style="float: left;margin-left: 170px;">
        <el-input type="hidden" v-model="info.id" style="width: 300px;"></el-input>
        <el-input type="hidden" v-model="info.store.id" style="width: 300px;"></el-input>
        <el-form-item label="店铺名" prop="store.sname">
            <el-input type="text" v-model="info.store.sname" style="width: 300px;"></el-input>
        </el-form-item>
        <el-form-item label="所属市场" prop="market.mname">
            <el-input type="text" readonly="readonly" v-model="info.market.mname" style="width: 300px;"></el-input>
        </el-form-item>
        <el-form-item label="店铺地址" prop="location.lname">
            <el-input readonly="readonly" v-model.number="info.location.lname" style="width: 300px;"></el-input>
        </el-form-item>
        <el-form-item label="经营类别" prop="category.category">
            <el-input readonly="readonly" v-model.number="info.category.category" style="width: 300px;"></el-input>
        </el-form-item>
        <el-form-item label="营业状态" prop="storeState.state">
            <el-select v-model="info.storeState.state" placeholder="今日店铺状态">
                <el-option v-for="(g,i) in stateArr" :label="g.state" :value="g.id"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="店铺注册人" prop="bname">
            <el-input readonly="readonly" v-model.number="info.bname" style="width: 300px;"></el-input>
        </el-form-item>
        <!--<el-form-item label="交租方式" prop="enterPayType.tname">-->
            <!--<el-input v-model.number="info.enterPayType.tname" style="width: 300px;" readonly="readonly"></el-input>-->
        <!--</el-form-item>-->
        <div style="text-align:center">
            <el-button type="success" @click="updateSeller()">修改信息</el-button>
        </div>
    </el-form>
    <span style="float: right; text-align: center; margin-right: 212px;" prop="license">
				<img :src="info.license" style="width: 300px;height: 300px">
				<div>营业执照</div>
    </span>




</div>


<script type="text/javascript">

    var app = new Vue({
        el:"#app",
        data:{
            info:{
                store:{},
                market:{},
                location:{},
                category:{},
                storeState:{},
                enterPayType:{}
            },
            stateArr:[],
            seller:{},
            bid:0
        },
        methods:{
            updateSeller:function () {
                app.seller.sname = app.info.store.sname;
                app.seller.state = app.info.storeState.state;
                app.seller.bid   = app.info.id;
                app.seller.stid=app.info.store.id;
                $.post("/cai/seller/updateSeller",app.seller,function (backData) {
                    if (backData.code==1){
                        app.$notify({
                            title: '温馨提示',
                            message:backData.msg,
                            type: 'success'
                        });
                        app.updateStuVisible = false;
                        getInfo();
                    } else {
                        app.$notify.error({
                            title: '温馨提示',
                            message:backData.msg
                        });
                        app.$refs["info"].resetFields();
                        $.get("/cai/seller/list/"+app.bid,function (listBackData) {
                            app.info=listBackData.data;
                        });
                    }
                });
            }
        }
    });

    $.get("/cai/consumer/getBid",function (backData) {
        app.bid = backData.data;
        $.get("/cai/seller/list/"+app.bid,function (listBackData) {
            app.info=listBackData.data;
        });
    });

    $.get("/cai/seller/listState",function (backData) {
        app.stateArr=backData.data;
    });
</script>
</body>
</html>
